// import { getOrgAllTree } from '@/api/system/org'
import { getFirmwareStoreTree } from '@/api/setting'
export default {
  data () {
    return {
      setModalStatus: false, // 二次modal弹框状态
      modalShow: false, // 批量操作对话框显示
      dataTree: [], // 树
      checkdList: [], // 已选的数组
      pageObj: {
        total: 0,
        pageIndex: 1,
        pageSize: 10
      },
      historyObj: {
        total: 0,
        pageIndex: 1,
        pageSize: 10
      },
      titleObj: {
        mainTitle: '批量设置',
        leftTitle: '可选门店',
        rightTitle: '已选门店',
        searchTitle: '选择门店',
        bottomTitle: '下一步'
      }
    }
  },
  methods: {
    cancelModal () {
      this.setModalStatus = false
      this.dataTree = []
      this.checkdList = []
    },
    skipPrevious () {
      this.setModalStatus = false
      this.modalShow = true
      this.allSet()
    },
    selctshopCancel () {
      this.modalShow = false
      this.dataTree = []
      this.checkdList = []
    },
    allSet () {
      getFirmwareStoreTree({ 'merchantId': this.$store.state.user.merchantId }).then(res => {
        this.modalShow = true
        if (res.data.status === 200) {
          this.dataTree = [res.data.data] || []
        } else {
          this.$Message.error(`${res.data.error}`)
        }
      }).catch(err => {
        this.$Message.error(`${err}`)
      })
    }
  }
}
